package cn.com.cifi.mars.constant;

/**
 * 系统字典类型
 * @author: JingYuanXiang
 * @date: 2020/12/10 10:03
 */
public enum SysDictionaryTypeEnum {

    TOLERACE("tolerance","回款系数容差"),

    ;
    private String key;
    private String value;

    SysDictionaryTypeEnum(String key, String value) {
        this.key = key;
        this.value = value;
    }

    public static String getKeyByValue(String value){
        for(SysDictionaryTypeEnum typeEnum:SysDictionaryTypeEnum.values()){
            if(value.equals(typeEnum.getValue())){
                return typeEnum.getKey();
            }
        }
        return  null;
    }

    public static String getValueByKey(String key){
        for(SysDictionaryTypeEnum typeEnum:SysDictionaryTypeEnum.values()){
            if(key.equals(typeEnum.getKey())){
                return typeEnum.getValue();
            }
        }
        return  null;
    }

    public String getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }
}
